<template>
	<view>
		<carHeader title="活动详情"></carHeader>
		<div class="zong">
			<div class="header1">
				<div class="header11">
					<span class="son1">标题:</span>
					<div style="display: inline-block;margin-left: 40px;">
						<span class="son2">{{this.list.riTitle}}</span>
					</div>

				</div>

				<div class="header11">
					<span class="son1">发布人:</span>
					<div style="display: inline-block;margin-left: 24px;">
						<span class="son2">{{this.list.merchant.merchantName}}</span>
					</div>
				</div>
				<div class="header11">
					<span class="son1">发布时间:</span>
					<div style="display: inline-block;margin-left: 7px;">
						<span class="son2">{{this.list.riTime}}</span>
					</div>
				</div>
				<div class="header11">
					<span class="son1">审核状态:</span>
					<div style="display: inline-block;margin-left: 7px;">
						<span class="son2">{{ displayReviewStatus(list.riReviewStatus) }}</span>
					</div>
				</div>
				<div class="header11">
				    <span class="son1">审核时间:</span>
				    <div style="display: inline-block; margin-left: 7px;" v-if="list.riReviewStatus !== 2">
				        <span class="son2">{{ this.list.checkInformation.ciTime}}</span>
				    </div>
				</div>
				<div class="header11">
					<span class="son1">审核说明:</span>
					<div style="display: inline-block;margin-left: 7px;">
						<span class="son2">{{this.list.checkInformation.ciExplain}}</span>
					</div>
				</div>

			</div>

			<div class="header2">
				<div class="header11" style="display: flex;">
					<div style="width: 200rpx;height: 200rpx;">
					<span class="son1">发布内容:</span>
					</div>
					<div style="width: 450rpx;height: 200rpx;">
						<span class="son22">
							{{this.list.riContent}}
						</span>
					</div>
				</div>
				
				<div class="header11" style="margin-top: 30px;">
				    <span class="son1" style="position: relative;top: -100px;">图片:</span>
				    <div style="display: inline-block;margin-left: 7px;">
				        <img class="i1" v-bind:src="list.riImage" alt="图片">
				    </div>
				</div>

				
				
			</div>

		</div>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: {
					riContent: '',
					riImage:'',
					riReviewStatus:'', 
					riShopId:'', 
					riStatus: '',
					riTime:'',
					riTitle: '',
					riPerson:'',
					riId:'',
					merchant:'',
					checkInformation:'',
					merchantName:''
				},
			}
		},
		methods: {
			 displayReviewStatus(status) {
			      if (status === 0) {
			        return '审核通过';
			      } else if (status === 1) {
			        return '审核不通过';
			      } else if (status === 2) {
			        return '待审核';
			      }
			      return '未知状态';
			    },
		},
		onLoad(options) {
			const id = options.id; // 获取 ID
			    const data = options.data ? JSON.parse(decodeURIComponent(options.data)) : {}; // 获取其他数据
			
			    console.log('ID:', id);
			    console.log('Data:', data);

		uni.request({
			url:`http://localhost:8080/carShop/carShop/activity/queryActivityById?id=${encodeURIComponent(id)}`,
			success: (res) => {
				this.list=res.data
			}
		})
	}
}
</script>

<style>
	* {
		margin: 0;
		padding: 0;
	}

	.zong {
		height: 1000rpx;
		width: 100%;
		background-color: #eeeeee;
	}

	.header1 {
		background-color: #ffffff;
		height: 600rpx;
		width: 690rpx;
		margin: 0 auto;
		position: relative;
		top: -120px;
		border-radius: 20px;
	}
	.header2 {
		background-color: #ffffff;
		height: 500rpx;
		width: 690rpx;
		margin: 0 auto;
		margin-top: 10px;
		position: relative;
		top: -120px;
		border-radius: 20px;
	}

	.header11 {
		width: 690rpx;
		height: 100rpx;
		/* 	background-color: antiquewhite; */
		border-radius: 20px;

	}

	.son1 {
		margin-left: 14px;
		font-weight: 600;
		font-size: 17px;
		position: relative;
		top: 12px;
	}

	.son2 {
		font-size: 16px;
		position: relative;
		top: 12px;
		margin-left: 10px;

	}
	.son22 {
		font-size: 16px;
		position: relative;
		top: 12px;
	
	
	}
	.i1{
		width: 130px;
		height: 130px;
		margin-left: 40px;
		position: relative;
		margin-top: 20px;
		
	}

</style>